<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <el-col class="top-left-col" :span="14">
        <el-card class="box-card">
          <p>机构概括</p>
          <div class="content">
            <div class="left-content">
              <div class="name">西三旗分拣中心</div>
              <div class="address">地址：北京顺义区天澜综合保税区123号</div>
              <div class="duty-people">负责人：赵五金 16712345678</div>
              <el-button
                class="el-button"
                type="danger"
                plain
              >查看营业部分布</el-button>
            </div>
            <div class="right-content">
              <div class="item">
                <div>
                  <div class="label">分拣中心(个)</div>
                  <div class="num">1</div>
                </div>
              </div>
              <div class="item">
                <div>
                  <div class="label">营业部(个)</div>
                  <div class="num">4</div>
                </div>
              </div>
              <div class="item">
                <div>
                  <div class="label">司机人数(个)</div>
                  <div class="num">48</div>
                </div>
              </div>
              <div class="item">
                <div>
                  <div class="label">快递员人数(个)</div>
                  <div class="num">64</div>
                </div>
              </div>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col class="top-right-col" :span="10">
        <div
          class="dashboard-col2 el-col el-col-10"
          style="padding-left: 12px; padding-right: 12px"
        >
          <div class="el-card box-card right-info is-always-shadow">
            <div
              class="el-card__body"
              style="padding-top: 21px; min-height: 60px"
            >
              <div class="header">
                <p>今日数据</p>
                <div class="refresh-box">2023-05-19 20:13</div>
              </div>
              <div
                class="row-bg el-row is-justify-space-around el-row--flex"
                span="24"
              >
                <div class="el-col el-col-8">
                  <div class="label">订单金额(元)</div>
                  <div id="my-number1" class="value">2,284</div>
                  <div class="bottom">较昨日 +342</div>
                </div>
                <div class="el-col el-col-8">
                  <div class="label">订单数量(笔)</div>
                  <div id="my-number2" class="value">193</div>
                  <div class="bottom">较昨日 +27</div>
                </div>
                <div class="el-col el-col-8">
                  <div class="label">运输任务(次)</div>
                  <div id="my-number3" class="value">38</div>
                  <div class="bottom">较昨日 +26</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-col>
      <el-col :span="14">
        <el-card class="box-card">
          <div v-for="o in 4" :key="o" class="text item">
            {{ '列表内容 ' + o }}
          </div>
        </el-card>
      </el-col>
      <el-col :span="10">
        <el-card class="box-card">
          <div v-for="o in 4" :key="o" class="text item">
            {{ '列表内容 ' + o }}
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters(['name'])
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
  margin: 24px;
  margin-top: 0;
  overflow-x: hidden;
  height: calc(100vh - 100px);
  .el-row {
    margin-top: 20px;
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .top-left-col {
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 4px;
    .box-card {
      padding: 10px 20px;
      p {
        font-size: 16px;
        font-weight: 700;
      }
      .content {
        position: relative;
        display: flex;
        .left-content {
          padding-left: 10px;
          -webkit-box-flex: 50%;
          -ms-flex: 50%;
          flex: 50%;
          border-right: 1px solid #ebeef5;
          .name {
            font-size: 16px;
            margin-top: 20px;
            margin-bottom: 13px;
          }
          .address {
            font-size: 14px;
            color: #818693;
          }
          .duty-people {
            font-size: 14px;
            color: #818693;
            margin-top: 8px;
            margin-bottom: 18px;
          }
          .el-button {
            font-size: 14px;
            border-radius: 4px;
            cursor: pointer;
            :hover {
              background: #ff6b4a !important;
              border-color: transparent !important;
              color: #fff !important;
            }
          }
        }
        .right-content {
          display: flex;
          -webkit-box-flex: 50%;
          -ms-flex: 50%;
          flex: 50%;
          width: 300px;
          -ms-flex-wrap: wrap;
          flex-wrap: wrap;
          .item {
            height: 85px;
            flex: 50%;
            -webkit-box-orient: vertical;
            -webkit-box-direction: normal;
            -ms-flex-direction: column;
            flex-direction: column;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            .label {
              font-size: 14px;
              margin-bottom: 10px;
            }
            .num {
              font-size: 32px;
              font-weight: 700;
              color: #e15536;
              cursor: pointer;
            }
          }
        }
      }
    }
  }
  .top-right-col {
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 4px;
    .el-col-10 {
      width: 542px;
      .box-card {
        padding: 23px 20px;
        .header {
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-box-pack: justify;
          -ms-flex-pack: justify;
          justify-content: space-between;
          -webkit-box-align: baseline;
          -ms-flex-align: baseline;
          align-items: baseline;
          p {
            margin-top: 0;
            font-size: 16px;
            color: #20232a;
            font-weight: 700;
          }
          .refresh-box {
            font-size: 14px;
            color: #818693;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            cursor: pointer;
          }
        }
        .is-justify-space-around {
          margin-top: 16px;
          padding-left: 10px;
          .el-col.el-col-8 {
            flex: 1;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-orient: vertical;
            -webkit-box-direction: normal;
            -ms-flex-direction: column;
            flex-direction: column;
            text-align: center;
            .label{
              font-size: 14px;
              color: #20232a;
              margin-bottom: 21px;
            }
            .value{
              font-size: 36px;
              color: #20232a;
              font-weight: 700;
              margin-bottom: 24px;
            }
            .bottom{
              font-size: 14px;
              color: #818693;
              margin-bottom: 20px;
              display: -webkit-box;
              display: -ms-flexbox;
              display: flex;
              -webkit-box-pack: center;
              -ms-flex-pack: center;
              justify-content: center;
              padding-left: 9px;
              ::after{
                content: "";
                display: inline-block;
                width: 15px;
                height: 15px;
              }
            }
          }
        }
      }
    }
  }
}
</style>
